how to create a type safe generic array in java - array